﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using GMaps;
using BLGPS;

public partial class EstadoActual : BasePage
{
    public override Perfil Perfil { get { return Perfil.Empresa; } }

  /*  [WebMethod(true)]
    public static string ObtenerCambios(string idCamion)
    {
        GMap map = (GMap)HttpContext.Current.Session["map"];

        GMarker g1 = new GMarker("marker", map, new GLatLng(-31.33F, -64.31F), "Prueba");
        GMarker g2 = new GMarker("marker2", map, new GLatLng(-31.45F, -64.1F), "Prueba");
        GMarker g3 = new GMarker("marker3", map, new GLatLng(-31.43F, -64.27F), "Prueba");
        GMarker g4 = new GMarker("marker4", map, new GLatLng(-31.36F, -64.3F), "Prueba");
        string script="["+g1.RenderJson()+","+g2.RenderJson()+","+g3.RenderJson()+","+g4.RenderJson()+"]";
        return script;
    }*/

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GInfoWindow info = new GInfoWindow();
            info.Content = "prueba";
#warning mostrar datos: flota, tipo vehiculo, descripcion,patente, chofer, estado motor, estado cilindros, en movimiento?


            GMap map = new GMap();
            map.Center = new GLatLng(-31.400F, -64.183F);
            map.DIV = "divMap";
            map.ID = "map";
            map.Zoom = 12;
            Session["map"] = map;

            GMarker marker = new GMarker("marker",map, map.Center,"Prueba");

            GEvent evento = new GEvent(marker,GEventTypes.Click);
            evento.HandlerCode = "infowindow.open(map,marker);";

            ScriptManager.RegisterStartupScript(this, this.GetType(), "", map.Render()+info.Render()+marker.Render()+evento.Render()  , true);
        }
    }

    protected void ctlFiltros_Consultar()
    {
        ColeccionVehiculo vehiculos= ctlFiltros.VehiculosSeleccionados;
        GridView1.DataSource = vehiculos;
        GridView1.DataBind();

    }
}